package arena;

import java.util.HashMap;

import com.jme.input.ChaseCamera;
import com.jme.input.thirdperson.ThirdPersonMouseLook;
import com.jme.math.FastMath;
import com.jme.math.Vector3f;
import com.jme.renderer.Camera;
import com.jme.scene.Spatial;

public class FollowCam extends ChaseCamera{
	
	public FollowCam(Camera cam, Spatial target, float distance) {
		super(cam,target);
		Vector3f targetOffset = new Vector3f();
        targetOffset.y=1f;
        HashMap<String, Object> props = new HashMap<String, Object>();
        props.put(ThirdPersonMouseLook.PROP_MAXROLLOUT, "10");
        props.put(ThirdPersonMouseLook.PROP_MINROLLOUT, "10");
        props.put(ThirdPersonMouseLook.PROP_MAXASCENT, ""+45 * FastMath.DEG_TO_RAD);
        props.put(ChaseCamera.PROP_INITIALSPHERECOORDS, new Vector3f(5, 0, 30 * FastMath.DEG_TO_RAD));
        props.put(ChaseCamera.PROP_TARGETOFFSET, targetOffset);
        
        this.setMaxDistance(6);
        this.setMinDistance(4);
        this.clearActions();
        this.setTarget(target);
	}

}
